import sched
import time


def print_event(name):
    print('Event：', time.time(), name)


print('Start：', time.time())

# 生成调度器
sche = sched.scheduler(time.time, time.sleep)

# 分别在2s,3s后执行调用函数
sche.enter(2, 1, print_event, ('first',))
sche.enter(3, 1, print_event, ('second',))

# 运行调度器
sche.run()
